/**
 * Created by litao on 2018/10/25.
 */
export default function (redirect) {

    const load = require('./import/_import_' + process.env.NODE_ENV);

    return {
        other: [{
            name: 'login',
            path: '/login',
            component: load('views/login/index'),
            meta: {
                permissionCode: '*'
            }
        },
            {
                name: 'error',
                path: '/error/:errorPageRoute?',
                props: true,
                component: load('views/error/index'),
                meta: {
                    permissionCode: '*'
                }
            }
        ],
        permission: [{
            name: '/',
            path: '/',
            component: load('views/layout/index'),
            redirect,
            children: [{
                name: 'zcgl',
                path: 'zcgl',
                component: load('views/zcgl/index'),
                meta: {
                    title: '资产管理',
                    permissionCode: 'zcgl',
                    icon: 'icon-liebiao'
                },
                redirect,
                children: [
                    {
                        name: 'xmgl',
                        path: 'xmgl',
                        component: load('views/zcgl/xmgl/index'),
                        meta: {title: '项目管理', permissionCode: 'xmgl', icon: 'icon-liebiao'},
                        redirect,
                        children: [
                            {
                                name: 'xmglList',
                                path: 'list',
                                component: load('views/zcgl/xmgl/list'),
                                meta: {title: '列表', permissionCode: 'xmgl', icon: 'icon-liebiao', hidden: true},
                            },
                            {
                                name: 'xmglInfo',
                                path: 'info/:routeParams',
                                props: true,
                                component: load('views/zcgl/xmgl/info'),
                                meta: {title: '详情', permissionCode: 'xmgl', icon: 'icon-biaodan', hidden: true},
                            }
                        ]
                    },
                    {
                        name: 'fjgl',
                        path: 'fjgl',
                        component: load('views/zcgl/fjgl/list'),
                        meta: {title: '房间管理', permissionCode: 'fjgl', icon: 'icon-liebiao'},
                    },
                    {
                        name: 'fjglAdd',
                        path: 'fjglAdd',
                        component: load('views/zcgl/fjgl/components/edit'),
                        meta: {title: '新增房间', permissionCode: 'fjgl', icon: 'icon-liebiao', hidden: true},
                    },
                    {
                        name: 'ftgl',
                        path: 'ftgl',
                        component: load('views/zcgl/ftgl/index'),
                        meta: {title: '房态管理',permissionCode: 'ftgl', icon: 'icon-liebiao'},
                        redirect,
                        children: [
                            {
                                name: 'ftglList',
                                path: 'list',
                                component: load('views/zcgl/ftgl/list'),
                                meta: {title: '房态管理-列表', permissionCode: 'ftgl', icon: 'icon-liebiao', hidden: true,},
                            },
                            {
                                name: 'tzbl',
                                path: 'tzbl/:routeParams',
                                props: true,
                                component: load('views/zcgl/ftgl/tzbl'),
                                meta: {title: '房态管理-退租办理',permissionCode: 'ftgl',icon: 'icon-liebiao',hidden: true,},
                            }
                        ]
                    }
                ]
            },
                {
                    name: 'htgl',
                    path: 'htgl',
                    component: load('views/htgl/index'),
                    meta: {title: '合同管理', permissionCode: 'htgl', icon: 'icon-liebiao'},
                    redirect,
                    children: [
                        {
                            name: 'htlb',
                            path: 'htlb',
                            component: load('views/htgl/htlb/index'),
                            meta: {title: '合同列表', permissionCode: 'htlb', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'yxslb',
                            path: 'yxslb',
                            component: load('views/htgl/yxslb/index'),
                            meta: {title: '意向书列表', permissionCode: 'yxslb', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'htbg',
                            path: 'htbg',
                            component: load('views/htgl/htbg/index'),
                            meta: {title: '合同变更', permissionCode: 'htbg', icon: 'icon-liebiao'},
                        }
                    ]
                },
                {
                    name: 'yygl',
                    path: 'yygl',
                    component: load('views/yygl/index'),
                    meta: {title: '运营管理', permissionCode: 'yygl', icon: 'icon-liebiao'},
                    redirect,
                    children: [
                        {
                            name: 'rzbl',
                            path: 'rzbl',
                            component: load('views/yygl/rzbl/index'),
                            meta: {title: '入驻办理', permissionCode: 'rzbl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'xzbl',
                            path: 'xzbl',
                            component: load('views/yygl/xzbl/index'),
                            meta: {title: '续租办理', permissionCode: 'xzbl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'tzbl',
                            path: 'tzbl',
                            component: load('views/yygl/tzbl/index'),
                            meta: {title: '退租办理', permissionCode: 'tzbl', icon: 'icon-liebiao'},
                        }
                    ]
                },
                {
                    name: 'cwgl',
                    path: 'cwgl',
                    component: load('views/cwgl/index'),
                    meta: {title: '财务管理', permissionCode: 'cwgl', icon: 'icon-liebiao'},
                    redirect,
                    children: [
                        {
                            name: 'zdgl',
                            path: 'zdgl',
                            component: load('views/cwgl/zdgl/index'),
                            meta: {title: '账单管理', permissionCode: 'zdgl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'ckzd',
                            path: 'ckzd',
                            component: load('views/cwgl/ckzd/index'),
                            meta: {title: '催款账单', permissionCode: 'ckzd', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'tkzd',
                            path: 'tkzd',
                            component: load('views/cwgl/tkzd/index'),
                            meta: {title: '退款账单', permissionCode: 'tkzd', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'jmzd',
                            path: 'jmzd',
                            component: load('views/cwgl/jmzd/index'),
                            meta: {title: '减免账单', permissionCode: 'jmzd', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'szgl',
                            path: 'szgl',
                            component: load('views/cwgl/szgl/index'),
                            meta: {title: '收支管理', permissionCode: 'szgl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'jbfx',
                            path: 'jbfx',
                            component: load('views/cwgl/jbfx/index'),
                            meta: {title: '基本费项', permissionCode: 'jbfx', icon: 'icon-liebiao'},
                        }
                    ]
                },
                {
                    name: 'khgl',
                    path: 'khgl',
                    component: load('views/khgl/index'),
                    meta: {title: '客户管理', permissionCode: 'khgl', icon: 'icon-liebiao'},
                    redirect,
                    children: [
                        {
                            name: 'zkgl',
                            path: 'zkgl',
                            component: load('views/khgl/zkgl/index'),
                            meta: {title: '租客管理', permissionCode: 'zkgl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'gkgl',
                            path: 'gkgl',
                            component: load('views/khgl/gkgl/index'),
                            meta: {title: '跟客管理', permissionCode: 'gkgl', icon: 'icon-liebiao'},
                        },
                        {
                            name: 'ksgl',
                            path: 'ksgl',
                            component: load('views/khgl/ksgl/index'),
                            meta: {title: '客商管理', permissionCode: 'ksgl', icon: 'icon-liebiao'},
                        }
                    ]
                },
                {
                    name: 'system',
                    path: 'system',
                    component: load('views/system/index'),
                    meta: {title: '系统设置', permissionCode: 'system', icon: 'icon-liebiao'},
                    redirect,
                    children: [
                        {
                            name: 'dict',
                            path: 'dict',
                            component: load('views/system/dict/index'),
                            meta: {title: '字典管理', permissionCode: 'dict', icon: 'icon-liebiao'},
                            redirect,
                            children: [
                                {
                                    name: 'systemDict',
                                    path: 'systemDict',
                                    component: load('views/system/dict/system/index'),
                                    meta: {title: '系统字典', permissionCode: 'systemDict', icon: 'icon-liebiao'},
                                },
                                {
                                    name: 'projectDict',
                                    path: 'projectDict',
                                    component: load('views/system/dict/project/index'),
                                    meta: {title: '项目字典', permissionCode: 'projectDict', icon: 'icon-liebiao'},
                                }
                            ]
                        }
                    ]
                }
            ]
        }]
    }
}
